import http from "@/http/index.ts"
import {Product,ProductForm,ProductListParam} from '@/api/product/type.ts'


// 新增产品
export const addApi = (data: ProductForm) => {
    return http.post("/product/createProduct", data)
}


// 分页条件查询列表
export const getListApi = (data:ProductListParam) => {
    return http.get("/product/getProductList",data)
}

// 根据产品的id查询产品的bom详情信息
export const getBomDetailByIdApi = (id:number) => {
    return http.get(`/product/productDetailById/${id}`,)
}


// 编辑
export const editApi = (data: ProductForm) => {
    return http.put("/product/updateProduct", data)
}

// 删除
export const deleteApi = (id: number) => {
    return http.delete(`/product/deleteProduct/${id}`)
}

